package com.niit.handlers;

public class EnumExample {

    // 定义一个枚举类型，表示一周的几天
    public enum Day {
        SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
    }

    public static void main(String[] args) {
        // 使用枚举类型
        Day today = Day.MONDAY;

        // 打印枚举值
        System.out.println("Today is " + today);

        // 使用枚举进行条件判断
        switch (today) {
            case MONDAY:
                System.out.println("Start of the work week.");
                break;
            case FRIDAY:
                System.out.println("End of the work week.");
                break;
            default:
                System.out.println("Midweek day.");
                break;
        }

        // 遍历枚举值
        System.out.println("Days of the week:");
        for (Day day : Day.values()) {
            System.out.println(day);
        }

        // 调用新方法
        printDayInfo(Day.FRIDAY);
    }

    // 新增方法：根据传入的枚举值打印相关信息
    public static void printDayInfo(Day day) {
        switch (day) {
            case MONDAY:
                System.out.println("It's Monday, time to start the week!");
                break;
            case TUESDAY:
                System.out.println("It's Tuesday, keep going!");
                break;
            case WEDNESDAY:
                System.out.println("It's Wednesday, halfway there!");
                break;
            case THURSDAY:
                System.out.println("It's Thursday, almost there!");
                break;
            case FRIDAY:
                System.out.println("It's Friday, the weekend is near!");
                break;
            case SATURDAY:
                System.out.println("It's Saturday, enjoy your weekend!");
                break;
            case SUNDAY:
                System.out.println("It's Sunday, relax and recharge!");
                break;
        }
    }
}